<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://qzone.qq.com/13463061455/page" prefix="w"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="frontDeskManager/css/frontDeskOrder.css?id=<%=new Date().getTime()%>" />
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
	$(function() {

		var hid = "${user.hid}";
		$
				.post(
						"frontDeskManager/zhanghuInfo.shtml",
						{
							"hid" : hid
						},
						function(data) {
							var t = "<p class='frontDeskIndextot'><img src='frontDeskManager/frontImages/OrderIndex/"+data.toimg+"' /></p>";
							var name = "<span style='color:#c2a36d;font-size:14px;letter-spacing:2px;'>"
									+ data.namesp + "</span>";
							$("#touxiang").append(t);
							$("#frontDeskIndex").append(name);

						})

		$(".frontDeskIndex-left-zhuti:eq(0)").siblings().css("display", "none");
		$(".frontDeskIndex-left-zhuti:eq(2)").siblings().css("display", "none");
		$(".frontDeskIndex-left-zhuti").click(function() {
			//var zhutiindex = $(".frontDeskIndex-left-zhuti").index(this);
			$(this).siblings().slideToggle();
		})
		$(".ordertype001 li:eq(${osid})")
				.addClass("ordertype001Childtypestyle");
		$(".ordertype001 li").click(function() {
			$(".w-orderFilterInput").val("");
			$(this).addClass("ordertype001Childtypestyle");
			$(this).siblings().removeClass("ordertype001Childtypestyle");
			var ordertypeindex = $(".ordertype001 li").index(this);
			$("#osid").val(ordertypeindex);
			$("#pageNo").val(1);
			$("#form1").trigger("submit");
		})

		$(".quxiaonextdan").click(
				function() {
					var nextdanIndex = $(".quxiaonextdan").index(this);
					$(".orderIdOrder").val(
							$(".xiadanhao:eq(" + nextdanIndex + ")").html())
					$("#form1").trigger("submit");
				})
		$(".selComment")
				.click(
						function() {
							var sel = $(".selComment").index(this);
							$(".sid").val($(".sids:eq(" + sel + ")").val());
							$(".goodsname").val(
									$(".goodsnames:eq(" + sel + ")").val());
							$("#form1").attr("action",
									"frontDeskManager/frontDeskComment.shtml");
							$("#form1").trigger("submit");
						})
		$(".cliComment")
				.click(
						function() {
							var sel = $(".cliComment").index(this);
							$(".sid").val($(".sids:eq(" + sel + ")").val());
							$(".goodsname").val(
									$(".goodsnames:eq(" + sel + ")").val());
							$("#form1").attr("action",
									"frontDeskManager/frontDeskComment2.shtml");
							$("#form1").trigger("submit");
						})
						$(".fukuan").click(function(){
							var fukuanindex = $(".fukuan").index(this);
							var orderid = $(".orderid").val($(".orderidsd:eq("+fukuanindex+")").val()).val();
							location.href="doOrder002.shtml?orderid="+orderid;
						})
						
						/* $("#commentInfo").click(function(){
							$("form1").trigger("submit");
						}) */
	})
	</script>
<link rel="stylesheet" href="css/Header.css?id=<%=new Date()%>" />

</head>
<body>
	<%@ include file="/Header.jsp"%>
	<div class="style-width">
		<form action="frontDeskManager/frontDeskOrder.shtml" id="form1"
			method="post">
			<input type="hidden" name="orderid" class="orderid" value="${order.olid }" />
			<div class="style-width-one clear">
				<div
					style="width: 160px; text-align: center; border: 1px solid #eaeaea; float: left; margin-top: 25px; padding-bottom: 20px; box-sizing: border-box; box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.1); border-radius: 4px;"
					class="frontDeskIndex-left">
					<div id="touxiang"></div>
					<p style="margin-top: 18px;" id="frontDeskIndex">
						<span>欢迎: </span>
					</p>
					<ul>
						<li class="frontDeskIndex-left-zhuti">账号管理</li>
						<li>账户信息</li>
						<li>地址管理</li>
						<li>我的积分</li>
						<li>我的收藏</li>
					</ul>
					<ul>
						<li class="frontDeskIndex-left-zhuti">交易管理</li>
						<li style="color: #b4a078">订单管理</li>
						<li>我的众筹</li>
					</ul>
					<ul>
						<li class="frontDeskIndex-left-zhuti">服务中心</li>
						<li>售后记录</li>
						<li>价格保护</li>
						<li>帮助中心</li>
					</ul>
				</div>
				<div
					style="float: left; width: 790px; margin-top: 25px; margin-left: 15px;">
					<div class="clear">
						<div class="left">
							<ul class="ordertype001" style="margin-top: 10px;">
								<li>全部订单</li>
								<li>未付款</li>
								<li>已付款</li>
								<li>已签收</li>
								<li>已取消</li>
								<li>已发货</li>
							</ul>
						</div>
						<div class="left">
							<div class="left" style="margin-left: 10px;">
								<input type="text" class="w-orderFilterInput"
									placeholder="输入商品名称或订单号搜索" name="InputorderId"
									value="${InputorderId }">
							</div>
							<div class="left">
								<input type="submit" class="w-orderFilterSubmitBtn" value="搜索">
							</div>
						</div>
					</div>
					<div style="margin-top: 20px;">
						<div class="m-noticeInfo" data-reactid=".3.1">防诈骗公告</div>
					</div>

					<input type="hidden" name="osid" id="osid" value="${osid }" />

					<c:forEach items="${listOrder }" var="order">
						<div style="margin-top: 15px;box-shadow: 2px 2px 10px rgba(0,0,0,0.1)" class="clear">
							<div
								style="border: 1px solid #ccc; border-bottom: none; height: 36px; line-height: 16px; padding: 10px 10px 10px 19px; box-sizing: border-box; background-color: #f5f5f5;"
								class="clear">
								<span>下单时间：</span> <span>${order.olDate }</span> <span
									style="margin-left: 75px;">订单号：</span> <span>${order.olid }</span>
									
							</div>
							<div class="clear" style="border: 1px solid #ccc;">
								<div>
									<div class="clear">
										<c:forEach items="${order.orderInfos }" var="orderinfo">
											<div
												style="width: 358px; margin: 15px 0px 0px 30px; float: left; position: relative;"
												class="xianxian">
												<div
													style="width: 70px; background-color: #f4f4f4; text-align: center; float: left;border-radius: 50%;">
													<img src="./${orderinfo.simg }" width="60px" style="border-radius: 50%;" />
												</div>
												<div
													style="float: left; margin-top: 20px; margin-left: 20px; letter-spacing: 6px;"
													id="goodName">${orderinfo.sname }</div>
												<c:if test="${order.osid == 3 }">
													<div class="clear"
														style="width: 200px; position: absolute; top: 46px; left: 177px;">

														<div
															style="width: 70px; height: 22px; text-align: center; border-radius: 4px; line-height: 22px; border: 1px solid #ccc; background-color: #f5f5f5; float: left;"
															class="selComment">查看评论</div>
														<input type="hidden" class="sids"
															value="${orderinfo.sid }" /> <input type="hidden"
															name="goodsnames" class="goodsnames"
															value="${orderinfo.sname } " />
														<div
															style="width: 70px; height: 22px; text-align: center; letter-spacing: 4px; border-radius: 4px; line-height: 22px; border: 1px solid #ccc; background-color: #f5f5f5; float: left; margin-left: 10px;"
															class="cliComment">点击评论</div>
													</div>
												</c:if>
												<div style="clear: both;"></div>
												<div
													style="width: 100%; height: 1px; border-top: 1px dashed #ececec; margin-top: 15px;"></div>
											</div>

										</c:forEach>


									</div>
									<div class="clear"
										style="width: 550px; height: 30px; text-align: right; margin-left: 250px;">
										<div class="right"
											style="width: 150px; text-align: center; height: 30px; line-height: 30px; margin-top: 15px;position: relative;">
											<c:if test="${order.osid == 5 }">
											<div
												style="width: 100px; height: 28px; letter-spacing: 4px; line-height: 28px; border: 1px solid #ccc; background-color: #f5f5f5;position:absolute;top:-40px;left:0px;" >
												<a href="frontDeskManager/frontDeskOrder.shtml?orderidstate001=${order.olid }">确认收货</a>
											</div>
											</c:if>
											<div
												style="width: 100px; height: 28px; letter-spacing: 4px; line-height: 28px; border: 1px solid #ccc; background-color: #f5f5f5;" id="commentInfo">
												<a href="frontDeskManager/frontDeskOrderInfo.shtml?orderid=${order.olid }">查看详情</a></div>
												
										</div>
										<div class="right"
											style="width: 150px; text-align: center; height: 30px; line-height: 30px; margin-top: 15px;">
											<span>总价：</span><span>￥</span><span style="color: red;">${order.money }</span>
										</div>
										<div class="right"
											style="width: 150px; position: relative; text-align: center; height: 30px; line-height: 30px; margin-bottom: 20px; margin-top: 15px; text-align: right;">
											<span>状态：</span><span style="color: #69c;"> <c:choose>
													<c:when test="${order.osid == 1 }">
						未付款
															<div
															style="width: 60px; float: right; position: absolute; bottom: 36px; left: 300px; height: 28px; line-height: 30px; text-align: center; color: #000"
															class="quxiaonextdan">取消下单</div>
															<div
															style="width:30px; float: right; position: absolute; bottom: 36px; left: 369px; height: 28px; line-height: 30px;  text-align: center; color: #000"
															class="fukuan">付款</div>
														<input type="hidden" name="orderIdOrder"
															class="orderIdOrder" />
															<input type="hidden" class="orderidsd" value="${order.olid }" />
														<span class="xiadanhao" >${order.olid }</span>
													</c:when>
													<c:when test="${order.osid == 2 }">
				已付款
				</c:when>
													<c:when test="${order.osid == 3 }">
				已收货
				</c:when>
													<c:when test="${order.osid == 4 }">
				已取消
				</c:when>
												<c:when test="${order.osid == 5 }">
				已发货
				</c:when>
												</c:choose>
											</span>
										</div>
									</div>
								</div>
							</div>
						</div>
					</c:forEach>
					<input type="hidden" name="sid" class="sid" /> <input
						type="hidden" name="goodsname" class="goodsname" />
					<div style="margin-top: 20px; margin-bottom: 20px;">
						<c:choose>
							<c:when test="${pageBeanOrder.total != 0 }">
								<w:page pageBeanOrder="${pageBeanOrder }" />
							</c:when>
							<c:when test="${pageBeanOrder.total == 0 }">
								<div
									style="text-align: center; font-size: 26px; color: #ddd; letter-spacing: 0.5em">
									<c:choose>
										<c:when test="${osid == 1 }">
											<img
												src="frontDeskManager/frontImages/OrderManager/orderCommentStatePic.gif"
												style="margin-top: 100px;" />
												<div style="color:#abaaaa;font-size:16px;">
												当前无未付款哈哈
												</div>
										</c:when>
										<c:when test="${osid == 2 }">
											<img
												src="frontDeskManager/frontImages/OrderManager/orderCommentStatePic.gif"
												style="margin-top: 100px;" />
												<div style="color:#abaaaa;font-size:16px;">
												当前无付款哈哈
												</div>
										</c:when>
										<c:when test="${osid == 3 }">
											<img
												src="frontDeskManager/frontImages/OrderManager/orderCommentStatePic.gif"
												style="margin-top: 100px;" />
												<div style="color:#abaaaa;font-size:16px;">
												当前无签收哈哈
												</div>
										</c:when>
										<c:when test="${osid == 4 }">
											<img
												src="frontDeskManager/frontImages/OrderManager/orderCommentStatePic.gif"
												style="margin-top: 100px;" />
												<div style="color:#abaaaa;font-size:16px;">
												当前无取消哈哈
												</div>
										</c:when>
										<c:when test="${osid == 5 }">
											<img
												src="frontDeskManager/frontImages/OrderManager/orderCommentStatePic.gif"
												style="margin-top: 100px;" />
												<div style="color:#abaaaa;font-size:16px;">
												当前无发货哈哈
												</div>
										</c:when>
									</c:choose>
								</div>
							</c:when>
						</c:choose>
					</div>
				</div>

			</div>
		</form>
	</div>

</body>
</html>